using System.Collections.Generic;

namespace FluentlyXml.UnitTests.Core.TestObjects
{
	public class Foo
	{
		public IList<Foo> SubFoos { get; set; }

		public string Name { get; set; }

		public IList<Bar> Bars { get; set; }

		public Foo Parent { get; set; }

		public int? Id { get; set; }

		public Foo()
		{
			SubFoos = new List<Foo>();
			Bars = new List<Bar>();
		}

		public static Foo GetTestFoo()
		{
			var root = new Foo
			       	{
						Id = 1, 
			       		Name = "Parent Foo",
						Bars = new List<Bar>{new Bar { Name = "Test Bar 1" }, new Bar{Name = "Test Bar 2"}},
						SubFoos = new List<Foo>
						          	{
						          		new Foo { Id = 2, Name = "Child Foo 1", Bars = new List<Bar>{new Bar{Name = "Test Bar 1"}}},
						          		new Foo { Id = 3, Name = "Child Foo 2", Bars = new List<Bar>{new Bar{Name = "Test Bar 1"}}},
						          	}
			       	};
			root.SubFoos[0].Parent = root;
			root.SubFoos[1].Parent = root;

			return root;
		}

	}
}